home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / g.dxr / 00008_G handlers.ls next >
Encoding:
Text File  |  1996-02-15  |  7.1 KB  |  246 lines

  1. global gHotRects, gObjects, sQTCharSprite, gHaveNavs, gCPU
  2.  
  3. on EnterG06
  4.   if voidp(getaProp(getaProp(gStates, #BeenThere), #G06)) then
  5.     PDARelease("J05hous.mov")
  6.   end if
  7.   set JenkinsPlayList to getaProp(getaProp(gObjects, #JenkinsVid), #Playlist)
  8.   if getPos(JenkinsPlayList, "G01jen6.mov") > 0 then
  9.     MakeDynamic(#G06NavRectParent, #State, #NavOn)
  10.   end if
  11. end
  12.  
  13. on setupG11A
  14.   resetGTextFields()
  15.   if getaProp(getaProp(gObjects, #LongTermStock), #solved) = #true then
  16.     Startthetimer(1, "goG07B")
  17.   end if
  18. end
  19.  
  20. on goG07B
  21.   genexitkf(#G07B)
  22. end
  23.  
  24. on calcTranstoG27 Test
  25.   if Test = #Debug then
  26.     return [#G27A, #G27B]
  27.   end if
  28.   if getPos(getaProp(getaProp(gObjects, #JenkinsVid), #Playlist), "G01jen6.mov") > 0 then
  29.     return #G27B
  30.   else
  31.     return #G27A
  32.   end if
  33. end
  34.  
  35. on resetGTextFields
  36.   put "testPIN" into field "G11PINDisplay.txt"
  37.   set the textFont of field "G11PINDisplay.txt" to "Monaco"
  38.   set the textSize of field "G11PINDisplay.txt" to 12
  39.   put "accountBalance" into field "G11BalanceDisplay.txt"
  40.   set the textFont of field "G11BalanceDisplay.txt" to "Monaco"
  41.   set the textSize of field "G11BalanceDisplay.txt" to 12
  42.   put "testPIN" into field "G11LPINDisplay.txt"
  43.   set the textFont of field "G11LPINDisplay.txt" to "Monaco"
  44.   set the textSize of field "G11LPINDisplay.txt" to 12
  45.   put "accountBalance" into field "G11LBalanceDisplay.txt"
  46.   set the textFont of field "G11LBalanceDisplay.txt" to "Monaco"
  47.   set the textSize of field "G11LBalanceDisplay.txt" to 12
  48.   put "LStocMH" into field "G11LStocMHdata.txt"
  49.   put "LStocOR" into field "G11LStocORdata.txt"
  50.   put "LStocMI" into field "G11LStocMIdata.txt"
  51.   put "LStocAT" into field "G11LStocATdata.txt"
  52.   put "LStocHA" into field "G11LStocHAdata.txt"
  53.   repeat with i = the number of cast "G11LStocMHdata.txt" to the number of cast "G11LStocHAdata.txt"
  54.     set the textFont of field i to "Monaco"
  55.     set the textSize of field i to 12
  56.   end repeat
  57.   clearGTextFields()
  58. end
  59.  
  60. on clearGTextFields
  61.   put " " into field "G11PINDisplay.txt"
  62.   put " " into field "G11BalanceDisplay.txt"
  63.   put " " into field "G11LPINDisplay.txt"
  64.   put " " into field "G11LBalanceDisplay.txt"
  65.   put " " into field "G11LStocMHdata.txt"
  66.   put " " into field "G11LStocORdata.txt"
  67.   put " " into field "G11LStocMIdata.txt"
  68.   put " " into field "G11LStocATdata.txt"
  69.   put " " into field "G11LStocHAdata.txt"
  70. end
  71.  
  72. on setGameOver
  73.   setaProp(getaProp(gStates, #Conditions), #LongStock, #true)
  74. end
  75.  
  76. on setJen6Vid
  77.   set JenkinsObj to getaProp(gObjects, #JenkinsVid)
  78.   set JenkinsPlayList to getaProp(JenkinsObj, #Playlist)
  79.   add(JenkinsPlayList, "G01jen6.mov")
  80. end
  81.  
  82. on DoOverVid OBJref
  83.   set OBj to getaProp(gObjects, OBJref)
  84.   set timesClicked to getaProp(OBj, #timesClicked)
  85.   if timesClicked = 0 then
  86.     DelObjects([OBJref])
  87.     DoCharacterMovie(#OverVid)
  88.     GameOverEnter()
  89.     Startthetimer(300, "setupGameOverJump", OBJref)
  90.     MakeDynamic(OBJref, #timesClicked, timesClicked + 1)
  91.   end if
  92. end
  93.  
  94. on setupGameOverJump
  95.   Startthetimer(the stopTime of sprite sQTCharSprite - the movieTime of sprite sQTCharSprite + 100, "jumpToGameOverFrame")
  96. end
  97.  
  98. on jumpToGameOverFrame
  99.   Jumptokey(#G07A)
  100. end
  101.  
  102. on CalcTransToG01
  103.   return #G01
  104. end
  105.  
  106. on calcTranstoG01AB Test
  107.   if Test = #Debug then
  108.     return [#G01A, #G01B]
  109.   end if
  110.   if getPos(getaProp(getaProp(gObjects, #JenkinsVid), #Playlist), "G01jen6.mov") > 0 then
  111.     return #G01B
  112.   else
  113.     return #G01A
  114.   end if
  115. end
  116.  
  117. on calcTranstoG07 Test
  118.   if Test = #Debug then
  119.     return [#G07, #G07B]
  120.   end if
  121.   if getaProp(getaProp(gStates, #Conditions), #LongStock) = #true then
  122.     MakeDynamic(#OverNavRectParent, #State, #NavOff)
  123.     return #G07B
  124.   else
  125.     if getPos(getaProp(getaProp(gObjects, #JenkinsVid), #Playlist), "G01jen6.mov") > 0 then
  126.       MakeDynamic(#OverNavRectParent, #State, #NavOn)
  127.       return #G07
  128.     else
  129.       return #G07
  130.     end if
  131.   end if
  132. end
  133.  
  134. on setNurseVid
  135.   set NurseObj to getaProp(gObjects, #NurseVid)
  136.   set nursePlayList to getaProp(NurseObj, #Playlist)
  137.   add(nursePlayList, "H04nsup.mov")
  138. end
  139.  
  140. on setDoc11Vid
  141.   set DocObj to getaProp(gObjects, #Doc11Vid)
  142.   set DocPlayList to getaProp(DocObj, #Playlist)
  143.   add(DocPlayList, "H11dps.mov")
  144. end
  145.  
  146. on setJenVid
  147.   set JenkinsObj to getaProp(gObjects, #JenkinsVid)
  148.   set JenkinsPlayList to getaProp(JenkinsObj, #Playlist)
  149.   add(JenkinsPlayList, "G01jen3.mov")
  150. end
  151.  
  152. on EnterCharConditonG01
  153.   set OBj to getaProp(gObjects, #JenkinsVid)
  154.   set NurseObj to getaProp(gObjects, #NurseVid)
  155.   set DocObj to getaProp(gObjects, #Doc11Vid)
  156.   set Playlist to getaProp(OBj, #Playlist)
  157.   set nursePlayList to getaProp(NurseObj, #Playlist)
  158.   set DocPlayList to getaProp(DocObj, #Playlist)
  159.   if getaProp(getaProp(gStates, #Conditions), #Defibrillate) = #true then
  160.     MakeDynamic(#JenkinsVid, #DisplayState, 5)
  161.     addUnique(Playlist, "G01jen6.mov")
  162.   else
  163.     if (getPos(Playlist, "G01jen3.mov") > 0) and (getPos(nursePlayList, "H04nsup.mov") > 0) then
  164.       MakeDynamic(#JenkinsVid, #DisplayState, 4)
  165.       addUnique(Playlist, "G01jenr2.mov")
  166.     else
  167.       if (getaProp(getaProp(gStates, #Conditions), #Defibrillate) <> #true) and (getaProp(getaProp(gStates, #BeenThere), #G01A) > 2) then
  168.         MakeDynamic(#JenkinsVid, #DisplayState, 6)
  169.         addUnique(Playlist, "G01jen2.mov")
  170.       else
  171.         if (getaProp(getaProp(gStates, #Conditions), #Defibrillate) <> #true) and (getaProp(getaProp(gStates, #BeenThere), #G01A) = 2) then
  172.           MakeDynamic(#JenkinsVid, #DisplayState, 3)
  173.           addUnique(Playlist, "G01jen3.mov")
  174.         else
  175.           if (getaProp(getaProp(gStates, #Conditions), #Defibrillate) <> #true) and (getaProp(getaProp(gStates, #BeenThere), #G01A) = 1) then
  176.             MakeDynamic(#JenkinsVid, #DisplayState, 2)
  177.             addUnique(Playlist, "G01jen5.mov")
  178.           else
  179.             if (getaProp(getaProp(gStates, #Conditions), #Defibrillate) <> #true) and (getaProp(getaProp(gStates, #BeenThere), #G01A) = 0) then
  180.               MakeDynamic(#JenkinsVid, #DisplayState, 1)
  181.               addUnique(Playlist, "G01jen1.mov")
  182.             else
  183.               setaProp(OBj, #DisplayState, #OffScreen)
  184.             end if
  185.           end if
  186.         end if
  187.       end if
  188.     end if
  189.   end if
  190.   MakeDynamic(#JenkinsVid, #Playlist, Playlist)
  191.   setaProp(OBj, #ConCount, 1)
  192. end
  193.  
  194. on doLeafJenkins
  195.   DelObjects([#JenkinsLeafrect])
  196.   ReleaseUNVobject(#Leaf2Obj)
  197. end
  198.  
  199. on Enter08JenkinsLeaf
  200.   if getaProp(getaProp(gObjects, #Leaf2Obj), #Aquired) <> #true then
  201.     AddObjects([#JenkinsLeafrect])
  202.   end if
  203. end
  204.  
  205. on Exit08JenkinsLeaf
  206.   if getaProp(getaProp(gObjects, #Leaf2Obj), #Aquired) <> #true then
  207.     DelObjects([#JenkinsLeafrect])
  208.   end if
  209. end
  210.  
  211. on doJenkins2
  212.   do("nothing")
  213.   dontPassEvent()
  214. end
  215.  
  216. on doFlylightrect
  217.   set OBj to getaProp(getaProp(gObjects, #Flylight), #animator)
  218.   if the pFrameRate of OBj < 120 then
  219.     set the pFrameRate of OBj to the pFrameRate of OBj + 20
  220.   else
  221.     set the pFrameRate of OBj to 10
  222.   end if
  223. end
  224.  
  225. on DoGotoG11B
  226.   set myChannel to playSound("G11log.aif", #keyframeCast)
  227.   if gCPU = #mpc then
  228.     set myTimer to the ticks
  229.     repeat while the ticks < (myTimer + 15)
  230.       CursorandUpdate()
  231.     end repeat
  232.   end if
  233.   repeat while soundBusy(myChannel)
  234.     CursorandUpdate()
  235.   end repeat
  236.   Jumptokey(#G11b)
  237. end
  238.  
  239. on DoGoShort
  240.   Jumptokey(#G11c)
  241. end
  242.  
  243. on DoGoLong
  244.   Jumptokey(#G11D)
  245. end
  246.